package com.liaowei.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liaowei.model.param.QueryArticleParam;
import com.liaowei.model.vo.ArticleVO;
import com.liaowei.model.domain.Article;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

/**
* @author LindaMan
* @description 针对表【wy_article(文章表)】的数据库操作Mapper
* @createDate 2023-05-06 23:31:37
* @Entity com.liaowei.article.model.domain.Article
*/
public interface ArticleMapper extends BaseMapper<Article> {
    // 修改文章信息
    int updateById(Article article);

    // 修改文章状态
    Integer updateStatusById(@Param("id") Long id,
                             @Param("status") int status,
                             @Param("updateTime")Timestamp timestamp);

    // 查询作者id
    long selectAuthorById(long id);

    // 前台条件分页查询文章列表
    List<ArticleVO> selectNewArticlePage(QueryArticleParam articleParam);
    int selectCountNewArticlePage(QueryArticleParam articleParam);

    // 根据id查询articleVO
    ArticleVO selectArticleVOById(Long id);

    // 查询文章热门排行
    List<ArticleVO> selectHotArticleList();

    // 根据标题模糊查询随机10条关键字
    List<Article> selectDiscoveryArticleList(String title);
}




